<ul class="sidebar-menu" data-widget="tree">
	<#list Session.firstLevelMenuList as menu>
		<li <#if (pModuleCode!"") == "${menu.menuCode}">class="treeview menu-open" </#if> class="treeview">
		<a href="#"><i class="fa fa-${menu.menuIcon}"></i> <span>${menu.menuName}</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
		<ul class="treeview-menu">
			<#list secondLevelMenuMap["${menu.menuId}"] as childMenu>
				<li <#if (moduleCode!"")=="${childMenu.menuCode}">class="active"</#if> >
				<#if "${childMenu.isJumpManage!}"=="1">
					<a href="javascript:void(0)" onclick="jump(${questionnaireCompanyId}, '${childMenu.requestType!}')"><i class="fa fa-${childMenu.menuIcon}"></i><span>${childMenu.menuName}</span></a>
					<#else>
						<a href="${ctx}${childMenu.menuUrl!}"><i class="fa fa-${childMenu.menuIcon}"></i> <span>${childMenu.menuName}</span></a>
				</#if>
				</li>
			</#list>
		</ul>
		</li>
	</#list>
</ul>

<script type="text/javascript">
    var win;
    $(function () {
        $(".menu-open").find(".treeview-menu").css("display", "block");
    });

    function jump(companyId, requestType) {
        var outPath = "${redirectUri!}";
        var url = "${ctx}/login/sysOutLogin";
        $.ajax({
            url: url,
            type: 'post',
            dataType: 'json',
            data: {"companyId": companyId},
            success: function (data) {
                if (data != null) {
                    var sign = data.sign;
                    var timestamps = data.timestamps;
                    //var newUrl = outPath + "login/sysOutLogin.action?_clientType=wap&sign=" + sign + "&timestamps=" + timestamps + "&companyId=" + companyId + "&requestType=" + requestType;
                    var newUrl = outPath+"#/jump?sign="+sign+"&timestamps="+timestamps+"&companyId="+companyId+"&requestType=" + requestType;
                    if (win) {
                        win.close();
                    }
                    window.open(newUrl, "_blank");
                } else {
                    bootbox.alert("跳转失败,请稍后重试!");
                }
            }
        });
    }
</script>
